import request from "@/utils/request";
import {API_BASE_URL, PAGE_NUM, TRANSACTIONS_PAGE_SIZE } from '@/constants'

export function getBlock(hashorHeight) {
  return request(API_BASE_URL + 'blockchain/block/' + hashorHeight, {
    method: 'GET'
  });
}

export function getBlockTransactions(hashOrHeight, page, size) {
  page = page || PAGE_NUM;
  size = size || TRANSACTIONS_PAGE_SIZE;

  return request(API_BASE_URL + 'blockchain/block/transactionlist/' + hashOrHeight + '?pageNum=' + page + '&pageSize=' + size, {
    method: 'GET'
  });
}
